package com.maple.soa.proxy;

import com.maple.soa.service.UserService;

/**
 * 静态代理-->UserService
 * @author lijian
 * @date 2020/7/5
 */
public class UserProxy implements UserService {
    private UserService userService;

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void save() {
        log("save");
        userService.save();
    }

    @Override
    public void update() {
        log("update");
        userService.update();
    }

    @Override
    public void getById(Long id) {
        log("getById");
        userService.getById(id);
    }

    @Override
    public void remove() {
        log("remove");
        userService.update();
    }

    public void log(String msg) {
        System.out.println("[debug] 调试日志: " + msg);
    }
}
